package subumbo.micro.controller
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;

	public class AbstractLoader extends URLLoader
	{
		public function AbstractLoader(url:String)
		{
			this.load(new URLRequest(url));
			this.addEventListener(Event.COMPLETE, onComplete);
		}
		
		protected function onComplete(e:Event):void
		{
			this.removeEventListener(Event.COMPLETE, onComplete);
			EventCentre.instance.dispatch(new ApplicationEvent(ApplicationEvent.MODEL_CACHED));	
		}
		
	}
}